type Meta = {
    msg: string
    status: number
}

type Data<T> = {
    message: T
    meta: Meta
}

type User = {
    name: string,
    age: number
}

type UserData = Data<User>


const person: UserData = {
    message: {
        name: "陶品奇",
        age: 22,
    },
    meta: {
        msg: "获取数据成功",
        status: 200
    }
}


interface DataInterface<T> {
    code: number,
    message: string,
    data: T
}

const result: DataInterface<(number | string)[]> = {
    code: 200,
    message: "成功",
    data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
}



function fn<T>(id: T): T {
    return id
}

const r: string = fn<string>("10")
console.log(r)

const b: number = fn(10)
console.log(b)

const fun = <A, B>(a: A, b: B): void => {
    console.log(a, b)
}

fun<number, string>(10, "20")
